import { ref } from 'vue';
import { defineStore } from 'pinia';

export const useSystemStore = defineStore(
  'pinia-system',
  () => {
    /**
     * 侧边栏折叠状态
     */
    const collapse = ref(false);
    /**
     * 切换侧边栏折叠状态
     */
    const changeCollapse = () => {
      collapse.value = !collapse.value;
    };

    return { collapse, changeCollapse };
  },
  {
    persist: true,
  },
);
